package demo2;

public class Person {
    public String name;
    public int age;
    public static String country;
    public static String city;

    static{
        country = "Singapore";
        System.out.println("静态代码块被执行1...");
    }

    static {
        city = "HongKong";
        System.out.println("静态代码块被执行2...");
    }

    {
        name = "kay";
        age = 20;
        System.out.println("实例代码块被执行1...");
    }

    {
        name = "ben";
        age = 21;
        System.out.println("实例代码块被执行2...");
    }

    public Person(){
        System.out.println("构造方法被执行...");
    }

    public void eat(){
        System.out.println(this.name + "正在吃饭...");
    }
}
